home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / QBWIZ12.ARJ / ERRLEVEL.ASM < prev    next >
Assembly Source File  |  1991-02-20  |  1KB  |  43 lines

  1. comment #
  2.  
  3.    +----------------------------------------------------------------------+
  4.    |                                                                      |
  5.    |         QBWIZ  Copyright (c) 1990-1991  Thomas G. Hanlin III         |
  6.    |                                                                      |
  7.    |                       QuickBASIC Access Library                      |
  8.    |                                                                      |
  9.    |               assembled with the excellent OPTASM by SLR             |
  10.    |                                                                      |
  11.    +----------------------------------------------------------------------+
  12.  
  13. #
  14.  
  15. public  ERRLEVEL
  16.  
  17.  
  18. .model medium
  19.  
  20. .code
  21.  
  22.  
  23.  
  24. extb  B$terminate
  25.  
  26.  
  27. ERRLEVEL      proc                     ; set error level
  28.               push           bp             ;
  29.               mov            bp,sp          ;
  30.               mov            ax,6[bp]       ;
  31.               push           ds             ;
  32.               lea            bx,B$terminate ;
  33.               mov byte ptr   cs:-3[bx],0B8h ; store opcode for "MOV AX,immed"
  34.               mov            cs:-2[bx],ax   ; store immediate value
  35.               pop            ds             ;
  36.               pop            bp             ;
  37.               ret            2              ;
  38. ERRLEVEL      endp                     ; set error level
  39.  
  40.  
  41.  
  42.               end
  43.